<!doctype html>



  


<html class="theme-next muse use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>






<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.1" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="java,spring,mvc," />








  <link rel="shortcut icon" type="image/x-icon" href="/uploads/images/logo/favicon.ico?v=5.1.1" />






<meta name="description" content="各软件版本123jdk:1.8maven:3.3.9tomcat:8.0.32 利用maven骨架建立一个webapp 选择create new module-Maven-Create from archetype。找到maven-archetype-webapp这个骨架，然后next。">
<meta name="keywords" content="java,spring,mvc">
<meta property="og:type" content="article">
<meta property="og:title" content="IntellJ Idea创建springmvc">
<meta property="og:url" content="http://xiaoxiaoqiang.win/2018/04/06/java/IntellJ-Idea创建springmvc/index.html">
<meta property="og:site_name" content="小小强的部落">
<meta property="og:description" content="各软件版本123jdk:1.8maven:3.3.9tomcat:8.0.32 利用maven骨架建立一个webapp 选择create new module-Maven-Create from archetype。找到maven-archetype-webapp这个骨架，然后next。">
<meta property="og:image" content="http://ossysbflp.bkt.clouddn.com/A003-02.png">
<meta property="og:image" content="http://ossysbflp.bkt.clouddn.com/A003-03.png">
<meta property="og:image" content="http://ossysbflp.bkt.clouddn.com/A003-04.png">
<meta property="og:image" content="http://ossysbflp.bkt.clouddn.com/A003-05.png">
<meta property="og:image" content="http://ossysbflp.bkt.clouddn.com/A003-06.png">
<meta property="og:image" content="http://ossysbflp.bkt.clouddn.com/A003-07.png">
<meta property="og:image" content="http://ossysbflp.bkt.clouddn.com/A003-08.png">
<meta property="og:image" content="http://ossysbflp.bkt.clouddn.com/A003-13.png">
<meta property="og:image" content="http://ossysbflp.bkt.clouddn.com/A003-12.png">
<meta property="og:image" content="http://ossysbflp.bkt.clouddn.com/A003-11.png">
<meta property="og:image" content="http://ossysbflp.bkt.clouddn.com/A003-09.png">
<meta property="og:image" content="http://ossysbflp.bkt.clouddn.com/A003-10.png">
<meta property="og:image" content="http://ossysbflp.bkt.clouddn.com/A003-14.png">
<meta property="og:updated_time" content="2018-04-06T11:34:27.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="IntellJ Idea创建springmvc">
<meta name="twitter:description" content="各软件版本123jdk:1.8maven:3.3.9tomcat:8.0.32 利用maven骨架建立一个webapp 选择create new module-Maven-Create from archetype。找到maven-archetype-webapp这个骨架，然后next。">
<meta name="twitter:image" content="http://ossysbflp.bkt.clouddn.com/A003-02.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Muse',
    sidebar: {"position":"left","display":"hide","offset":12,"offset_float":0,"b2t":false,"scrollpercent":false},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://xiaoxiaoqiang.win/2018/04/06/java/IntellJ-Idea创建springmvc/"/>





  <title>IntellJ Idea创建springmvc | 小小强的部落</title>

</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  














  
  
    
  

  <div class="container sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">小小强的部落</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">我思故我在</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
    <link itemprop="mainEntityOfPage" href="http://xiaoxiaoqiang.win/2018/04/06/java/IntellJ-Idea创建springmvc/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="小小强">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/uploads/images/logo/icon.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="小小强的部落">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">IntellJ Idea创建springmvc</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2018-04-06T19:32:22+08:00">
                2018-04-06
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/java/" itemprop="url" rel="index">
                    <span itemprop="name">java</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    <div class="post-body" itemprop="articleBody">

      
      

      
        <h3 id="各软件版本"><a href="#各软件版本" class="headerlink" title="各软件版本"></a>各软件版本</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">jdk:1.8</div><div class="line">maven:3.3.9</div><div class="line">tomcat:8.0.32</div></pre></td></tr></table></figure>
<h3 id="利用maven骨架建立一个webapp"><a href="#利用maven骨架建立一个webapp" class="headerlink" title="利用maven骨架建立一个webapp"></a>利用maven骨架建立一个webapp</h3><ul>
<li>选择create new module-Maven-Create from archetype。找到maven-archetype-webapp这个骨架，然后next。</li>
</ul>
<p><img src="http://ossysbflp.bkt.clouddn.com/A003-02.png" alt="">  </p>
<a id="more"></a>
<p><img src="http://ossysbflp.bkt.clouddn.com/A003-03.png" alt="">  </p>
<ul>
<li>输入GroupId和ArtifactId后下一步。</li>
</ul>
<p><img src="http://ossysbflp.bkt.clouddn.com/A003-04.png" alt=""> </p>
<ul>
<li>填写本地的maven环境，这里可以选择自己本地的环境，也可以用idea自带的maven3.0.5。配置相应的配置文件，idea自带的maven是没有配置文件的，需要单独配置的可以在相应的目录中添加setting.xml文件，例如需要配置jdk版本或者maven mirror的。  </li>
</ul>
<p><img src="http://ossysbflp.bkt.clouddn.com/A003-05.png" alt=""> </p>
<p><img src="http://ossysbflp.bkt.clouddn.com/A003-06.png" alt=""> </p>
<p>由于maven骨架和一些jar需要去maven的仓库下载，所以创建项目的时候速度会非常慢（外国的服务器你懂得），因此我们可以直接访问<a href="http://repo1.maven.org/maven2/archetype-catalog.xml，把这个xml下载下来放到本地的maven目录中，然后在添加一个参数archetypeCatalog=internal就可以了。" target="_blank" rel="external">http://repo1.maven.org/maven2/archetype-catalog.xml，把这个xml下载下来放到本地的maven目录中，然后在添加一个参数archetypeCatalog=internal就可以了。</a></p>
<ul>
<li>next 填写项目名称，finish即可。<br><img src="http://ossysbflp.bkt.clouddn.com/A003-07.png" alt=""> </li>
</ul>
<p><img src="http://ossysbflp.bkt.clouddn.com/A003-08.png" alt=""> </p>
<p>然后配置tomcat</p>
<p><img src="http://ossysbflp.bkt.clouddn.com/A003-13.png" alt=""></p>
<p><img src="http://ossysbflp.bkt.clouddn.com/A003-12.png" alt=""> </p>
<p><img src="http://ossysbflp.bkt.clouddn.com/A003-11.png" alt=""> </p>
<h3 id="建立相应的目录"><a href="#建立相应的目录" class="headerlink" title="建立相应的目录"></a>建立相应的目录</h3><p>项目创建完成后，src-main下建立java目录后，是无法在该目录下创建新的包和java类等文件的。在idea中需要对目录进行标注。</p>
<p><img src="http://ossysbflp.bkt.clouddn.com/A003-09.png" alt=""> </p>
<p><img src="http://ossysbflp.bkt.clouddn.com/A003-10.png" alt=""> </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div></pre></td><td class="code"><pre><div class="line">Sources 一般用于标注类似 src 这种可编译目录。有时候我们不单单项目的src 目录要可编译，还有其他</div><div class="line">一些特别的目录也许我们也要作为可编译的目录，就需要对该目录进行此标注。只有 Sources 这种可编译目录</div><div class="line">才可以新建 Java类和包，这一点需要牢记。</div><div class="line"></div><div class="line">Tests 一般用于标注可编译的单元测试目录。在规范的 maven项目结构中，顶级目录是 src，maven的src</div><div class="line">我们是不会设置为 Sources的，而是在其子目录 main 目录下的 java 目录，我们会设置为Sources。而单元</div><div class="line">测试的目录是 src - test - java，这里的 java目录我们就会设置为Tests，表示该目录是作为可编译的单元</div><div class="line">测试目录。一般这个和后面几个我们都是在maven项目下进行配置的，但是我这里还是会先说说。从这一点我们也可</div><div class="line">以看出IntelliJ IDEA 对 maven项目的支持是比较彻底的。</div><div class="line"></div><div class="line">Resources 一般用于标注资源文件目录。在 maven项目下，资源目录是单独划分出来的，其目录为：src - </div><div class="line">main -resources，这里的 resources 目录我们就会设置为Resources，表示该目录是作为资源目录。资源</div><div class="line">目录下的文件是会被编译到输出目录下的。</div><div class="line"></div><div class="line">Test Resources 一般用于标注单元测试的资源文件目录。在 maven项目下，单元测试的资源目录是单独划分出</div><div class="line">来的，其目录为：src - test-resources，这里的 resources 目录我们就会设置为 TestResources，表</div><div class="line">示该目录是作为单元测试的资源目录。资源目录下的文件是会被编译到输出目录下的。</div><div class="line"></div><div class="line">- Excluded 一般用于标注排除目录。被排除的目录不会被 IntelliJ IDEA创建索引，相当于被 IntelliJ</div><div class="line">IDEA废弃，该目录下的代码文件是不具备代码检查和智能提示等常规代码功能。</div><div class="line"></div><div class="line">- 通过上面的介绍，我们知道对于非 maven 项目我们只要会设置 src 即可。</div><div class="line"></div><div class="line">（引用自http://wiki.jikexueyuan.com/project/intellij-idea-tutorial/ecli</div><div class="line">pse-java-web-project-introduce.html）</div></pre></td></tr></table></figure>
<h3 id="配置Maven和SpringMVC"><a href="#配置Maven和SpringMVC" class="headerlink" title="配置Maven和SpringMVC"></a>配置Maven和SpringMVC</h3><h4 id="配置Maven的pom-xml"><a href="#配置Maven的pom-xml" class="headerlink" title="配置Maven的pom.xml"></a>配置Maven的pom.xml</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div><div class="line">42</div><div class="line">43</div><div class="line">44</div><div class="line">45</div><div class="line">46</div><div class="line">47</div><div class="line">48</div><div class="line">49</div><div class="line">50</div><div class="line">51</div><div class="line">52</div><div class="line">53</div><div class="line">54</div><div class="line">55</div><div class="line">56</div><div class="line">57</div><div class="line">58</div><div class="line">59</div><div class="line">60</div><div class="line">61</div><div class="line">62</div><div class="line">63</div><div class="line">64</div><div class="line">65</div><div class="line">66</div><div class="line">67</div><div class="line">68</div><div class="line">69</div><div class="line">70</div><div class="line">71</div><div class="line">72</div><div class="line">73</div><div class="line">74</div><div class="line">75</div><div class="line">76</div><div class="line">77</div><div class="line">78</div><div class="line">79</div><div class="line">80</div><div class="line">81</div><div class="line">82</div><div class="line">83</div><div class="line">84</div><div class="line">85</div><div class="line">86</div><div class="line">87</div><div class="line">88</div><div class="line">89</div><div class="line">90</div><div class="line">91</div><div class="line">92</div><div class="line">93</div><div class="line">94</div><div class="line">95</div><div class="line">96</div><div class="line">97</div><div class="line">98</div><div class="line">99</div><div class="line">100</div><div class="line">101</div><div class="line">102</div></pre></td><td class="code"><pre><div class="line">&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</div><div class="line">  xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&quot;&gt;</div><div class="line">  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;</div><div class="line">  &lt;groupId&gt;com.sdt&lt;/groupId&gt;</div><div class="line">  &lt;artifactId&gt;SpringMvc&lt;/artifactId&gt;</div><div class="line">  &lt;packaging&gt;war&lt;/packaging&gt;</div><div class="line">  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;</div><div class="line">  &lt;name&gt;SpringMvc Maven Webapp&lt;/name&gt;</div><div class="line">  &lt;url&gt;http://maven.apache.org&lt;/url&gt;</div><div class="line">  &lt;dependencies&gt;</div><div class="line">    &lt;dependency&gt;</div><div class="line">      &lt;groupId&gt;junit&lt;/groupId&gt;</div><div class="line">      &lt;artifactId&gt;junit&lt;/artifactId&gt;</div><div class="line">      &lt;version&gt;3.8.1&lt;/version&gt;</div><div class="line">      &lt;scope&gt;test&lt;/scope&gt;</div><div class="line">    &lt;/dependency&gt;</div><div class="line">    &lt;dependency&gt;</div><div class="line">      &lt;groupId&gt;junit&lt;/groupId&gt;</div><div class="line">      &lt;artifactId&gt;junit&lt;/artifactId&gt;</div><div class="line">      &lt;version&gt;3.8.1&lt;/version&gt;</div><div class="line">      &lt;scope&gt;test&lt;/scope&gt;</div><div class="line">    &lt;/dependency&gt;</div><div class="line">    &lt;dependency&gt;</div><div class="line">      &lt;groupId&gt;org.slf4j&lt;/groupId&gt;</div><div class="line">      &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;</div><div class="line">      &lt;version&gt;1.7.21&lt;/version&gt;</div><div class="line">    &lt;/dependency&gt;</div><div class="line"></div><div class="line">    &lt;!--j2ee相关包 servlet、jsp、jstl--&gt;</div><div class="line">    &lt;dependency&gt;</div><div class="line">      &lt;groupId&gt;javax.servlet&lt;/groupId&gt;</div><div class="line">      &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;</div><div class="line">      &lt;version&gt;3.1.0&lt;/version&gt;</div><div class="line">    &lt;/dependency&gt;</div><div class="line">    &lt;dependency&gt;</div><div class="line">      &lt;groupId&gt;javax.servlet.jsp&lt;/groupId&gt;</div><div class="line">      &lt;artifactId&gt;jsp-api&lt;/artifactId&gt;</div><div class="line">      &lt;version&gt;2.2&lt;/version&gt;</div><div class="line">    &lt;/dependency&gt;</div><div class="line">    &lt;dependency&gt;</div><div class="line">      &lt;groupId&gt;javax.servlet&lt;/groupId&gt;</div><div class="line">      &lt;artifactId&gt;jstl&lt;/artifactId&gt;</div><div class="line">      &lt;version&gt;1.2&lt;/version&gt;</div><div class="line">    &lt;/dependency&gt;</div><div class="line"></div><div class="line">    &lt;!--mysql驱动包--&gt;</div><div class="line">    &lt;dependency&gt;</div><div class="line">      &lt;groupId&gt;mysql&lt;/groupId&gt;</div><div class="line">      &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;</div><div class="line">      &lt;version&gt;5.1.35&lt;/version&gt;</div><div class="line">    &lt;/dependency&gt;</div><div class="line"></div><div class="line">    &lt;!--spring相关包--&gt;</div><div class="line">    &lt;dependency&gt;</div><div class="line">      &lt;groupId&gt;org.springframework&lt;/groupId&gt;</div><div class="line">      &lt;artifactId&gt;spring-web&lt;/artifactId&gt;</div><div class="line">      &lt;version&gt;4.3.15.RELEASE&lt;/version&gt;</div><div class="line">    &lt;/dependency&gt;</div><div class="line">    &lt;dependency&gt;</div><div class="line">      &lt;groupId&gt;org.springframework&lt;/groupId&gt;</div><div class="line">      &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;</div><div class="line">      &lt;version&gt;4.3.15.RELEASE&lt;/version&gt;</div><div class="line">    &lt;/dependency&gt;</div><div class="line"></div><div class="line">    &lt;!--其他需要的包--&gt;</div><div class="line">    &lt;dependency&gt;</div><div class="line">      &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;</div><div class="line">      &lt;artifactId&gt;commons-lang3&lt;/artifactId&gt;</div><div class="line">      &lt;version&gt;3.4&lt;/version&gt;</div><div class="line">    &lt;/dependency&gt;</div><div class="line">    &lt;dependency&gt;</div><div class="line">      &lt;groupId&gt;commons-fileupload&lt;/groupId&gt;</div><div class="line">      &lt;artifactId&gt;commons-fileupload&lt;/artifactId&gt;</div><div class="line">      &lt;version&gt;1.3.1&lt;/version&gt;</div><div class="line">    &lt;/dependency&gt;</div><div class="line">  &lt;/dependencies&gt;</div><div class="line"></div><div class="line">  &lt;build&gt;</div><div class="line">    &lt;finalName&gt;SpringMvc&lt;/finalName&gt;</div><div class="line">    &lt;resources&gt;</div><div class="line">      &lt;!--表示把java目录下的有关xml文件,properties文件编译/打包的时候放在resource目录下--&gt;</div><div class="line">      &lt;resource&gt;</div><div class="line">        &lt;directory&gt;$&#123;basedir&#125;/src/main/java&lt;/directory&gt;</div><div class="line">        &lt;includes&gt;</div><div class="line">          &lt;include&gt;**/*.properties&lt;/include&gt;</div><div class="line">          &lt;include&gt;**/*.xml&lt;/include&gt;</div><div class="line">        &lt;/includes&gt;</div><div class="line">      &lt;/resource&gt;</div><div class="line">      &lt;resource&gt;</div><div class="line">        &lt;directory&gt;$&#123;basedir&#125;/src/main/resources&lt;/directory&gt;</div><div class="line">      &lt;/resource&gt;</div><div class="line">    &lt;/resources&gt;</div><div class="line">    &lt;plugins&gt;</div><div class="line">      &lt;!--servlet容器 jetty插件--&gt;</div><div class="line">      &lt;plugin&gt;</div><div class="line">        &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;</div><div class="line">        &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;</div><div class="line">        &lt;version&gt;9.3.10.v20160621&lt;/version&gt;</div><div class="line">      &lt;/plugin&gt;</div><div class="line">    &lt;/plugins&gt;</div><div class="line">  &lt;/build&gt;</div><div class="line">&lt;/project&gt;</div></pre></td></tr></table></figure>
<h4 id="配置web-xml"><a href="#配置web-xml" class="headerlink" title="配置web.xml"></a>配置web.xml</h4><p>maven默认生成的web.xml版本是2.3的，所以有些配置节点idea会识别不出来，因此我们重新添加一个3.0的。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div></pre></td><td class="code"><pre><div class="line">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</div><div class="line">&lt;web-app xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot;</div><div class="line">         xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</div><div class="line">         xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/javaee</div><div class="line">          http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd&quot;</div><div class="line">         version=&quot;3.0&quot;&gt;</div><div class="line">  &lt;!--welcome pages--&gt;</div><div class="line">  &lt;welcome-file-list&gt;</div><div class="line">    &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;</div><div class="line">  &lt;/welcome-file-list&gt;</div><div class="line"></div><div class="line">  &lt;!--配置springmvc DispatcherServlet--&gt;</div><div class="line">  &lt;servlet&gt;</div><div class="line">    &lt;servlet-name&gt;springMVC&lt;/servlet-name&gt;</div><div class="line">    &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;</div><div class="line">    &lt;init-param&gt;</div><div class="line">      &lt;!--Sources标注的文件夹下需要新建一个spring文件夹--&gt;</div><div class="line">      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;</div><div class="line">      &lt;param-value&gt;classpath:spring-mvc.xml&lt;/param-value&gt;</div><div class="line">    &lt;/init-param&gt;</div><div class="line">    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;</div><div class="line">    &lt;async-supported&gt;true&lt;/async-supported&gt;</div><div class="line">  &lt;/servlet&gt;</div><div class="line">  &lt;servlet-mapping&gt;</div><div class="line">    &lt;servlet-name&gt;springMVC&lt;/servlet-name&gt;</div><div class="line">    &lt;url-pattern&gt;/&lt;/url-pattern&gt;</div><div class="line">  &lt;/servlet-mapping&gt;</div><div class="line">&lt;/web-app&gt;</div></pre></td></tr></table></figure></p>
<h4 id="配置spring-mvc-xml"><a href="#配置spring-mvc-xml" class="headerlink" title="配置spring-mvc.xml"></a>配置spring-mvc.xml</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div><div class="line">42</div><div class="line">43</div><div class="line">44</div><div class="line">45</div><div class="line">46</div><div class="line">47</div><div class="line">48</div><div class="line">49</div><div class="line">50</div></pre></td><td class="code"><pre><div class="line">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</div><div class="line">&lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;</div><div class="line">       xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</div><div class="line">       xmlns:context=&quot;http://www.springframework.org/schema/context&quot;</div><div class="line">       xmlns:mvc=&quot;http://www.springframework.org/schema/mvc&quot;</div><div class="line">       xsi:schemaLocation=&quot;http://www.springframework.org/schema/beans</div><div class="line">                        http://www.springframework.org/schema/beans/spring-beans-3.2.xsd</div><div class="line">                         http://www.springframework.org/schema/context</div><div class="line">                        http://www.springframework.org/schema/context/spring-context-3.2.xsd</div><div class="line">                        http://www.springframework.org/schema/mvc</div><div class="line">                        http://www.springframework.org/schema/mvc/spring-mvc.xsd&quot;&gt;</div><div class="line">    &lt;!--启用spring的一些annotation --&gt;</div><div class="line">    &lt;context:annotation-config/&gt;</div><div class="line"></div><div class="line">    &lt;!-- 自动扫描该包，使SpringMVC认为包下用了@controller注解的类是控制器 --&gt;</div><div class="line">    &lt;context:component-scan base-package=&quot;com.example.controller&quot;&gt;</div><div class="line">        &lt;context:include-filter type=&quot;annotation&quot; expression=&quot;org.springframework.stereotype.Controller&quot;/&gt;</div><div class="line">    &lt;/context:component-scan&gt;</div><div class="line"></div><div class="line">    &lt;!--HandlerMapping 无需配置，springmvc可以默认启动--&gt;</div><div class="line"></div><div class="line">    &lt;!--静态资源映射--&gt;</div><div class="line">    &lt;!--本项目把静态资源放在了WEB-INF的statics目录下，资源映射如下--&gt;</div><div class="line">    &lt;mvc:resources mapping=&quot;/css/**&quot; location=&quot;/WEB-INF/statics/css/&quot;/&gt;</div><div class="line">    &lt;mvc:resources mapping=&quot;/js/**&quot; location=&quot;/WEB-INF/statics/js/&quot;/&gt;</div><div class="line">    &lt;mvc:resources mapping=&quot;/image/**&quot; location=&quot;/WEB-INF/statics/image/&quot;/&gt;</div><div class="line"></div><div class="line">    &lt;!--但是项目部署到linux下发现WEB-INF的静态资源会出现无法解析的情况，但是本地tomcat访问正常，因此建议还是直接把静态资源放在webapp的statics下，映射配置如下--&gt;</div><div class="line">    &lt;!--&lt;mvc:resources mapping=&quot;/css/**&quot; location=&quot;/statics/css/&quot;/&gt;--&gt;</div><div class="line">    &lt;!--&lt;mvc:resources mapping=&quot;/js/**&quot; location=&quot;/statics/js/&quot;/&gt;--&gt;</div><div class="line">    &lt;!--&lt;mvc:resources mapping=&quot;/image/**&quot; location=&quot;/statics/images/&quot;/&gt;--&gt;</div><div class="line"></div><div class="line">    &lt;!-- 配置注解驱动 可以将request参数与绑定到controller参数上 --&gt;</div><div class="line">    &lt;mvc:annotation-driven/&gt;</div><div class="line"></div><div class="line">    &lt;!-- 对模型视图名称的解析，即在模型视图名称添加前后缀(如果最后一个还是表示文件夹,则最后的斜杠不要漏了) 使用JSP--&gt;</div><div class="line">    &lt;!-- 默认的视图解析器 在上边的解析错误时使用 (默认使用html)- --&gt;</div><div class="line">    &lt;bean id=&quot;defaultViewResolver&quot; class=&quot;org.springframework.web.servlet.view.InternalResourceViewResolver&quot;&gt;</div><div class="line">        &lt;property name=&quot;viewClass&quot; value=&quot;org.springframework.web.servlet.view.JstlView&quot;/&gt;</div><div class="line">        &lt;property name=&quot;prefix&quot; value=&quot;/WEB-INF/views/&quot;/&gt;&lt;!--设置JSP文件的目录位置--&gt;</div><div class="line">        &lt;property name=&quot;suffix&quot; value=&quot;.jsp&quot;/&gt;</div><div class="line">    &lt;/bean&gt;</div><div class="line"></div><div class="line">    &lt;!-- springmvc文件上传需要配置的节点--&gt;</div><div class="line">    &lt;bean id=&quot;multipartResolver&quot; class=&quot;org.springframework.web.multipart.commons.CommonsMultipartResolver&quot;&gt;</div><div class="line">        &lt;property name=&quot;maxUploadSize&quot; value=&quot;20971500&quot;/&gt;</div><div class="line">        &lt;property name=&quot;defaultEncoding&quot; value=&quot;UTF-8&quot;/&gt;</div><div class="line">        &lt;property name=&quot;resolveLazily&quot; value=&quot;true&quot;/&gt;</div><div class="line">    &lt;/bean&gt;</div><div class="line">&lt;/beans&gt;</div></pre></td></tr></table></figure>
<h4 id="配置log4j-properties"><a href="#配置log4j-properties" class="headerlink" title="配置log4j.properties"></a>配置log4j.properties</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div></pre></td><td class="code"><pre><div class="line">#配置根Logger 后面是若干个Appender</div><div class="line">#log4j.rootLogger=DEBUG,A1,R</div><div class="line">log4j.rootLogger=INFO,A1,R</div><div class="line"></div><div class="line"># ConsoleAppender 输出</div><div class="line">log4j.appender.A1=org.apache.log4j.ConsoleAppender</div><div class="line">log4j.appender.A1.layout=org.apache.log4j.PatternLayout</div><div class="line">log4j.appender.A1.layout.ConversionPattern=%-d&#123;yyyy-MM-dd HH:mm:ss,SSS&#125; [%c]-[%p] %m%n</div><div class="line"></div><div class="line"># File 输出 一天一个文件,输出路径可以定制,一般在根路径下</div><div class="line">log4j.appender.R=org.apache.log4j.DailyRollingFileAppender</div><div class="line">log4j.appender.R.File=log.txt</div><div class="line">log4j.appender.R.MaxFileSize=500KB</div><div class="line">log4j.appender.R.MaxBackupIndex=10</div><div class="line">log4j.appender.R.layout=org.apache.log4j.PatternLayout</div><div class="line">log4j.appender.R.layout.ConversionPattern=%d&#123;yyyy-MM-dd HH:mm:ss,SSS&#125; [%t] [%c] [%p] - %m%n</div></pre></td></tr></table></figure>
<h4 id="controller和view的编写"><a href="#controller和view的编写" class="headerlink" title="controller和view的编写"></a>controller和view的编写</h4><p>在controller下新建一个“HomeController”。编写如下代码。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div></pre></td><td class="code"><pre><div class="line">package com.example.controller;</div><div class="line"></div><div class="line">import org.springframework.stereotype.Controller;</div><div class="line">import org.springframework.web.bind.annotation.RequestMapping;</div><div class="line">import org.slf4j.Logger;</div><div class="line">import org.slf4j.LoggerFactory;</div><div class="line">/**</div><div class="line"> * Created by dyn on 18/4/6.</div><div class="line"> */</div><div class="line">@Controller</div><div class="line">@RequestMapping(&quot;/home&quot;)</div><div class="line">public class HomeController &#123;</div><div class="line">    //添加一个日志器</div><div class="line">    private static final Logger logger = LoggerFactory.getLogger(HomeController.class);</div><div class="line"></div><div class="line">    //映射一个action</div><div class="line">    @RequestMapping(&quot;/index&quot;)</div><div class="line">    public  String index()&#123;</div><div class="line">        //输出日志文件</div><div class="line">        logger.info(&quot;the first jsp pages&quot;);</div><div class="line">        //返回一个index.jsp这个视图</div><div class="line">        return &quot;index&quot;;</div><div class="line">    &#125;</div><div class="line">&#125;</div></pre></td></tr></table></figure></p>
<p>在views文件夹下建立一个jsp文件，名为“index.jsp”,基本的代码编写就完成了。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div></pre></td><td class="code"><pre><div class="line">&lt;%--</div><div class="line">  Created by IntelliJ IDEA.</div><div class="line">  User: dyn</div><div class="line">  Date: 18/4/6</div><div class="line">  Time: 下午6:49</div><div class="line">  To change this template use File | Settings | File Templates.</div><div class="line">--%&gt;</div><div class="line">&lt;%@ page contentType=&quot;text/html;charset=UTF-8&quot; language=&quot;java&quot; %&gt;</div><div class="line">&lt;html&gt;</div><div class="line">&lt;head&gt;</div><div class="line">    &lt;title&gt;Hello Spring&lt;/title&gt;</div><div class="line">&lt;/head&gt;</div><div class="line">&lt;body&gt;</div><div class="line">Hello Spring</div><div class="line">&lt;/body&gt;</div><div class="line">&lt;/html&gt;</div></pre></td></tr></table></figure></p>
<p>参考tomcat章节启动服务后，输入<a href="http://localhost:8080/home/index查看输出。完成后的目录结构如下。" target="_blank" rel="external">http://localhost:8080/home/index查看输出。完成后的目录结构如下。</a></p>
<p><img src="http://ossysbflp.bkt.clouddn.com/A003-14.png" alt=""></p>
<h4 id="一些问题"><a href="#一些问题" class="headerlink" title="一些问题"></a>一些问题</h4><ul>
<li>log4j的配置文件要放在 resources目录下，否则不生效。</li>
<li>spring-mvc.xml同上。</li>
</ul>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        
  <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
    <div>坚持原创技术分享，您的支持将鼓励我继续创作！</div>
    <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
      <span>赏</span>
    </button>
    <div id="QR" style="display: none;">
      
        <div id="wechat" style="display: inline-block">
          <img id="wechat_qr" src="/uploads/images/money/wechat.JPG" alt="小小强 WeChat Pay"/>
          <p>微信打赏</p>
        </div>
      
      
        <div id="alipay" style="display: inline-block">
          <img id="alipay_qr" src="/uploads/images/money/ali.JPG" alt="小小强 Alipay"/>
          <p>支付宝打赏</p>
        </div>
      
    </div>
  </div>


      
    </div>

    <div>
      
        

      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/java/" rel="tag"># java</a>
          
            <a href="/tags/spring/" rel="tag"># spring</a>
          
            <a href="/tags/mvc/" rel="tag"># mvc</a>
          
        </div>
      

      
        
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2018/03/19/java/java工作知识点-unicode/" rel="next" title="java工作知识点-unicode">
                <i class="fa fa-chevron-left"></i> java工作知识点-unicode
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div id="uyan_frame"></div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/uploads/images/logo/icon.jpg"
               alt="小小强" />
          <p class="site-author-name" itemprop="name">小小强</p>
           
              <p class="site-description motion-element" itemprop="description">技术之路历练</p>
          
        </div>
        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
              <a href="/archives">
                <span class="site-state-item-count">18</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-categories">
              <a href="/categories/index.html">
                <span class="site-state-item-count">5</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">18</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/wayd2001" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://www.jianshu.com/u/5813fda87ee0" target="_blank" title="JianShu">
                  
                    <i class="fa fa-fw fa-book"></i>
                  
                  JianShu
                </a>
              </span>
            
          
        </div>

        
        
          <div class="cc-license motion-element" itemprop="license">
            <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" class="cc-opacity" target="_blank">
              <img src="/images/cc-by-nc-sa.svg" alt="Creative Commons" />
            </a>
          </div>
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              Links
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.jianshu.com/u/5813fda87ee0" title="小小强简书" target="_blank">小小强简书</a>
                </li>
              
            </ul>
          </div>
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#各软件版本"><span class="nav-number">1.</span> <span class="nav-text">各软件版本</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#利用maven骨架建立一个webapp"><span class="nav-number">2.</span> <span class="nav-text">利用maven骨架建立一个webapp</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#建立相应的目录"><span class="nav-number">3.</span> <span class="nav-text">建立相应的目录</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#配置Maven和SpringMVC"><span class="nav-number">4.</span> <span class="nav-text">配置Maven和SpringMVC</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#配置Maven的pom-xml"><span class="nav-number">4.1.</span> <span class="nav-text">配置Maven的pom.xml</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#配置web-xml"><span class="nav-number">4.2.</span> <span class="nav-text">配置web.xml</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#配置spring-mvc-xml"><span class="nav-number">4.3.</span> <span class="nav-text">配置spring-mvc.xml</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#配置log4j-properties"><span class="nav-number">4.4.</span> <span class="nav-text">配置log4j.properties</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#controller和view的编写"><span class="nav-number">4.5.</span> <span class="nav-text">controller和view的编写</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#一些问题"><span class="nav-number">4.6.</span> <span class="nav-text">一些问题</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js">
</script>
<span id="busuanzi_container_site_pv">
    本站总访问量<span id="busuanzi_value_site_pv"></span>次
</span>

<span id="busuanzi_container_site_uv">
  本站访客数<span id="busuanzi_value_site_uv"></span>人次
</span>


<div class="copyright" >
  
  &copy;  2017 - 
  <span itemprop="copyrightYear">2018</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">小小强</span>
</div>



<div class="powered-by">
  由 <a class="theme-link" href="#">小小强</a> 个人专属
</div>

<div class="theme-info">
  博客 -
  <a class="theme-link" href="#">
   小小强
  </a>
</div>
<p>Hosted by <a href="https://pages.coding.me" style="font-weight: bold">Coding Pages</a></p>


        

        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.1"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.1"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.1"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.1"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.1"></script>



  


  




	





  





  
    

    
      <!-- UY BEGIN -->
      <script type="text/javascript" src="http://v2.uyan.cc/code/uyan.js?uid=2138352"></script>
      <!-- UY END -->
    
  





  






  





  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  

  

  



</body>
</html>
